{extend name="public/base" /}
{block name="body"}
<div class="layui-fluid">
  	<div class="layui-row">
    	<div class="layui-col-md12 layui-col-xs12">
			<div class="widget-head">
				<div class="widget-title">文章列表</div>
			</div>
		</div>
		<div class="layui-col-md12 layui-col-xs12 widget-body">
			<div class="layui-u-sm-3 layui-u-md-3 layui-col-lg3">
			    <!-- 工具栏 -->
				<div class="page_toolbar">
					<div class="layui-btn-group">
						<a class="layui-btn" href="{:url('Article/add')}"><i class="menu-icon fa fa-plus"></i> 新增</a>
						<a href="{:url('Article/del')}" class="layui-btn ajax-batch"><i class="fa fa-trash-o"></i> 删除</a>
					</div>
				</div>		
			</div>
			<div class="layui-u-sm-9 layui-u-md-9 layui-col-lg9">
				<form class="layui-form" method="post" action="{:url('Article/index')}"> 
		    		<div class="layui-form-item">
			    		<div class="layui-input-inline">
							<input name="title" type="text" class="layui-input" placeholder="请输入文章标题" value="">	
						</div>
						<div class="layui-input-inline">
							<select name="status">
                        		<option value="">是否正常</option>
                        		<option value="1" {if condition="input('?status') and (input('status') eq 1)"} selected="selected"{/if}>是</option>
                        		<option value="0" {if condition="input('?status') and (input('status') eq 0)"} selected="selected"{/if}>否</option>
                    		</select>
						</div>
						<div class="layui-input-inline">
							<button class="layui-btn layui-btn-primary ajax-search"><i class="fa fa-search"></i></button>
						</div>
					</div>		    	
				</form>
			</div>
			<div class="layui-col-md12">
				<table class="layui-table layui-form">
					<thead>
						<tr>
							<th width="30"><input type="checkbox" lay-skin="primary" lay-filter="*"></th>
							<th>ID</th>
							<th>标题</th>
							<th>分类</th>
							<th>浏览量</th>
							<th>状态</th>
							<th>新增时间</th>
							<th>操作</th>
						</tr> 
					</thead>
					<tbody>
						{empty name="list"}
						<tr>
							<td colspan="12" class="layer-text-center">暂无记录</td>
						</tr>
						{else /}
							{volist name="list" id="vo"}
							<tr>
								<td><input type="checkbox" name="id" value="{$vo.id}" lay-skin="primary"></td>
								<td>{$vo.id}</td>
								<td>{$vo.title}</td>
								<td>{$vo.category.name}</td>
								<td>{$vo.click}</td>
								<td><input type="checkbox" name="status" lay-skin="switch" lay-filter="*" lay-text="是|否" data-url="{:url('Article/update?id='.$vo['id'])}" {if $vo.status eq 1}checked="checked"{/if}> </td>
								<td>{$vo.create_time}</td>
								<td>
									<a href="{:url('Article/edit?id='.$vo['id'])}" class="layui-btn layui-btn-xs layui-btn-normal"><i class="fa fa-edit"></i> 编辑</a>
                        			<a href="{:url('Article/del?id='.$vo['id'])}" class="layui-btn layui-btn-xs layui-btn-danger ajax-delete"><i class="fa fa-trash-o"></i> 删除</a>
								</td>
							</tr>
							{/volist}
						{/empty}
					</tbody>
				</table>
				<div class="layui-col-md12 layui-col-xs12">
					<div class="page">{$list->render()|raw}</div>
				</div>
			</div>
		</div>
  	</div>
</div>
{/block}  